//
//  TableViewCell.m
//  iphone.sprintview
//
//  Created by wangjun on 10-12-1.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "TableViewCell.h"
@implementation TableViewCell
@synthesize myLable,myButton,checked,myTableDelegate;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  [super setSelected:selected animated:animated];
}
- (void)dealloc {
	[self.myButton release];
	[self.myLable release];
    [super dealloc];
}
-(IBAction)onClickButton:(id)sender
{
	self.checked = !self.checked;
	UIImage *checkImage = (self.checked) ? [UIImage imageNamed:@"checked.png"] : [UIImage imageNamed:@"unchecked.png"];
	[myButton setImage:checkImage forState:UIControlStateNormal];
	if (myTableDelegate!=nil) {
		[myTableDelegate checkedButton:sender checked:self.checked];
	}
}
@end
